package tech.aistar.pojo;

import lombok.*;

import java.io.Serializable;
@Data
@AllArgsConstructor
@NoArgsConstructor
@RequiredArgsConstructor
public class Result<T> implements Serializable {
    @NonNull
    private String code;
    @NonNull
    private String msg;

    private T data;

    public static <T> Result<T> success(T data) {
        return new Result<>("200","success",data);
    }
    public static <T> Result<T> success() {
        return new Result<>("200","success");
    }

    public static <T> Result<T> fail(String message) {
        return new Result<>("500",message);
    }
}
